﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace lcmyjobs.Web.Admin
{
    public partial class shownews : System.Web.UI.Page
    {
        public string strid = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (Session["adminName"] != null)
                {
                    if (Request.Params["id"] != null && Request.Params["id"].Trim() != "")
                    {
                        strid = Request.Params["id"];
                        int nid = (Convert.ToInt32(strid));
                        ShowInfo(nid);
                    }
                }
                else
                {
                    Maticsoft.Common.MessageBox.ResponseScript(this, "alert('请先登陆！');top.location.href='adminlogin2.aspx'");
                }

            }
        }

        private void ShowInfo(int nid)
        {
            lcmyjobs.BLL.news bll = new lcmyjobs.BLL.news();
            DataSet ds = bll.GetNews(nid);
            if (ds.Tables[0].Rows.Count > 0)
            {
                //ntitle, ntime,truename,ntname,ncontent
                this.lblntitle.Text = ds.Tables[0].Rows[0][0].ToString();
                this.lblntime.Text = ds.Tables[0].Rows[0][1].ToString();
                this.lblnauthor.Text = ds.Tables[0].Rows[0][2].ToString();
                //this.lblviewtime.Text = model.viewtime.ToString();
                this.lblncontent.Text = ds.Tables[0].Rows[0][4].ToString();
                this.lblntid.Text = ds.Tables[0].Rows[0][3].ToString(); ;
            }

        }

        protected void btnBack_Click(object sender, EventArgs e)
        {
            Response.Redirect("newslist.aspx");
        }
    }
}